<%@page import="skyinline.j2ee.basic.projectv5.dao.BoardDAO"%>
<%@ page contentType="text/html; charset=utf-8" 
pageEncoding="utf-8" %>
<jsp:useBean id="b"
class="skyinline.j2ee.basic.projectv5.model.BoardVO" />
<jsp:setProperty property="*" name="b" />
<% b = BoardDAO.viewBoard(b); %>

		<style type="text/css">
			.contents { width: 550px; height: 250px;
				display: inline-block; 
				border: 1px solid gold;
				overflow: auto; }
			.dragup { vertical-align: top; }	
		</style>

		<div id="content">
			<h2>게시판 본문</h2>
			<div id="view">
				<div><label>제목</label><span> <%=b.getTitle() %> </span></div>
				<div><label>작성자</label><span><%=b.getUid() %></span></div>
				<div><label>작성일</label><span><%=b.getWdate() %> </span></div>
				<div><label>조회수</label><span><%=b.getReades() %> </span></div>
				<div><label class="dragup">본문</label>
				<span class="contents">
				<%=b.getContents().replace("\r\n","<br />") %>
				</span></div>
				<div><label> </label><button type="button" id="updbtn">수정하기</button>
					<button type="button" id="delbtn">삭제하기</button> </div>
			</div>
		</div><!-- // content -->
		
		<script type="text/javascript">
			var deletebtn = document.getElementById("delbtn");
			deletebtn.onclick = function () { 
				if ( confirm('정말로 삭제하시겠습니까?') ) {
					location.href="?action=deleteok&bdno="+<%=b.getBdno()%>;                            
				}
			};
			var updatebtn = document.getElementById("updbtn");
			updatebtn.onclick = function() {
				location.href="?action=update&bdno=" + <%=b.getBdno()%>;
			};
		</script>
		

